home *** CD-ROM | disk | FTP | other *** search
- /*
- * FlatDevice.h - class definition for zBuffer device driver.
- *
- * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
- * University of Berne, Switzerland
- * All rights reserved.
- *
- * This software may be freely copied, modified, and redistributed
- * provided that this copyright notice is preserved on all copies.
- *
- * You may not distribute this software, in whole or in part, as part of
- * any commercial product without the express consent of the authors.
- *
- * There is no warranty or other guarantee of fitness of this software
- * for any purpose. It is provided solely "as is".
- *
- */
-
- #ifndef FlatDevice_H
- # define FlatDevice_H
-
- #include "DeviceDriver.h"
- #include "BaseWindow.h"
- #include "ViewTransform.h"
- #include "Z_Buffer.h"
-
- /*___________________________________________________________ FlatDevice
- *
- * Z-buffer device driver. Uses class Z_Buffer to generate a image
- * in ppm-format (portable pixmap).
- */
-
- class PolyWithColorList;
-
- class FlatDevice : public DeviceDriver
- {
- public:
- FlatDevice(Options*);
- ~FlatDevice();
-
- void begin();
- void end(const BoundingBox&);
- void cylinder(const Vector&, const Vector&, real);
- void cone(const Vector&, real, const Vector&, real);
- void polygon(Polygon*);
- void sphere(const Vector&, real);
- void color(const Color&);
- void beginMacro(const rcString&);
- void endMacro();
- void executeMacro(const rcString&, const TransMatrix&);
-
- private:
- rcString currentMacroName;
- PolyWithColorList* polys; // storage for polys in macro definition
-
- Color currentColor;
- ViewTransform* view;
- Z_Buffer* zBuffer;
-
- int coneResolution;
- int sphereResolution;
- real* sintable; // precompute sin, cos for fast cone generation
- real* costable;
- Vector* top;
- Vector* bottom;
-
- PolygonList* unitSphere;
- };
-
- #endif // FlatDevice_H
-